package com.ruoyi.patent.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.patent.mapper.PContractTypeMapper;
import com.ruoyi.patent.domain.PContractType;
import com.ruoyi.patent.service.IPContractTypeService;

/**
 * 合同类型Service业务层处理
 *
 * @author ruoyi
 * @date 2022-04-11
 */
@Service
public class PContractTypeServiceImpl implements IPContractTypeService
{
    @Autowired
    private PContractTypeMapper pContractTypeMapper;

    /**
     * 查询合同类型
     *
     * @param ctypeId 合同类型主键
     * @return 合同类型
     */
    @Override
    public PContractType selectPContractTypeByCtypeId(Long ctypeId)
    {
        return pContractTypeMapper.selectPContractTypeByCtypeId(ctypeId);
    }

    /**
     * 查询合同类型列表
     *
     * @param pContractType 合同类型
     * @return 合同类型
     */
    @Override
    public List<PContractType> selectPContractTypeList(PContractType pContractType)
    {
        return pContractTypeMapper.selectPContractTypeList(pContractType);
    }

    /**
     * 新增合同类型
     *
     * @param pContractType 合同类型
     * @return 结果
     */
    @Override
    public int insertPContractType(PContractType pContractType)
    {
        pContractType.setCreateTime(DateUtils.getNowDate());
        return pContractTypeMapper.insertPContractType(pContractType);
    }

    /**
     * 修改合同类型
     *
     * @param pContractType 合同类型
     * @return 结果
     */
    @Override
    public int updatePContractType(PContractType pContractType)
    {
        return pContractTypeMapper.updatePContractType(pContractType);
    }

    /**
     * 批量删除合同类型
     *
     * @param ctypeIds 需要删除的合同类型主键
     * @return 结果
     */
    @Override
    public int deletePContractTypeByCtypeIds(Long[] ctypeIds)
    {
        return pContractTypeMapper.deletePContractTypeByCtypeIds(ctypeIds);
    }

    /**
     * 删除合同类型信息
     *
     * @param ctypeId 合同类型主键
     * @return 结果
     */
    @Override
    public int deletePContractTypeByCtypeId(Long ctypeId)
    {
        return pContractTypeMapper.deletePContractTypeByCtypeId(ctypeId);
    }
}
